<?php
class Admin_Form_Product extends Zend_Form
{
	public function init()
	{
		$this->setName("product");
		$this->setMethod("POST");

		$idPro = new Zend_Form_Element_Hidden('idPro');
		$idPro->addFilter('Int');
	    $namePro= new Zend_Form_Element_Text('namePro');
	    $namePro->setLabel("LoaiSanPham")
	    		->setRequired(true)
	    		->addFilter('StripTags')
	    		->addFilter("StringTrim")
	    		->addValidator('NotEmpty');
	    $sumaryPro= new Zend_Form_Element_Textarea('textarea3');
	    $sumaryPro->setLabel('Tom tat');
	    $descripPro= new Zend_Form_Element_Textarea('textarea2');
	    $descripPro->setLabel('Chi Tiet');
	    
	    $image= new Zend_Form_Element_File('image');
	    $image->setLabel('Image')
	    	->addValidator("Count",false,1)
	    	->addValidator("Extension",false,"jpg,gif")
	    	->addValidator("Filessize",false,array("min"=>1000,"max"=>1000000))
	    	->addValidator("ImageSize",false,array("minwidth"=>50,"maxwidth"=>300,"minheight"=>50,"maxheight"=>300));
	    	
	  
	    $image->setDestination("public/upload");
	    	 
	   
       
	    
	    $hid= new Zend_Form_Element_Hidden('hidimage');
	    $idSes= new Zend_Form_Element_Text('idSes');
	    $idSes->setLabel("idTL");
	    
	    $idCat= new Zend_Form_Element_Text('idCat');
	    $idCat->setLabel("idCat");
	    
	    $date = new Zend_Form_Element_Text('date');
	    $date->setLabel('Ngày Đăng')
	    	 
	    	 ->addFilter('StripTags')
	    	 ->addFilter('StringTrim')
	    	 ->addValidator('NotEmpty');
	    	 
	    $count = new Zend_Form_Element_Text('count');
	    $count->setLabel('Số Lượng')
	    	  ->addFilter('Int');	 
	    
	    $price = new Zend_Form_Element_Text('price');
	    $price->setLabel('Giá');
	          
	    	 
	    
	    $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitcat');
        	   
	    $this->addElements(array( $idPro,$namePro,$sumaryPro,$descripPro,$image,$hid,$idSes,$idCat,$date,$count,$price,$submit ));	  		
		
	}

}